﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SPALM
{
	/// <summary>
	/// Provides attribute for integration with MSBuild Sidekick v2. Specifies task action for which task parameter is relevant
	/// </summary>
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
	public sealed class TaskActionAttribute : Attribute
	{
		private readonly string actionData;
		private readonly bool requiredData;

		/// <summary>
		/// Specifies task action for which task parameter is relevant
		/// </summary>
		/// <param name="taskAction">Task action for which task parameter is relevant</param>
		/// <param name="required">Indicates if task parameter is required for specified task action</param>
		public TaskActionAttribute(string taskAction, bool required)
		{
			this.actionData = taskAction;
			this.requiredData = required;
		}

		/// <summary>
		/// Sets the task action
		/// </summary>
		public string TaskAction
		{
			get
			{
				return actionData;
			}
		}

		/// <summary>
		/// Indicates if task parameter is required for specified task action
		/// </summary>
		public bool Required
		{
			get
			{
				return requiredData;
			}
		}
	}

	/// <summary>
	/// Provides attribute for integration with MSBuild Sidekick v2. Specifies help url for the task
	/// </summary>
	[AttributeUsage(AttributeTargets.Class)]
	public sealed class HelpUrlAttribute : Attribute
	{
		private readonly string data;

		/// <summary>
		/// Specifies help url for the task
		/// </summary>
		/// <param name="url">Help url</param>
		public HelpUrlAttribute(string url)
		{
			this.data = url;
		}

		/// <summary>
		/// Gets the help url
		/// </summary>
		public string Url
		{
			get
			{
				return data;
			}
		}
	}

	/// <summary>
	/// Provides attribute for integration with MSBuild Sidekick v2. Specify entry for the parameter dropdown list
	/// </summary>
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
	public sealed class DropdownValueAttribute : Attribute
	{
		private readonly string data;

		/// <summary>
		/// Specify entry for the parameter dropdown list
		/// </summary>
		/// <param name="value">Entry value</param>
		public DropdownValueAttribute(string value)
		{
			this.data = value;
		}

		/// <summary>
		/// Gets the dropdown entry value
		/// </summary>
		public string Value
		{
			get
			{
				return data;
			}
		}
	}
}
